var app = getApp()
Page({
  data: {
    infodialog: false,//提交信息成功显示结果dialog
    editdialog:false,//修改手机号dialog
    identity:true,//身份已认证
    unidentity:true,//未认证,
    isyes:true,
    userInfo:{},
    info:{}
  },
  onShareAppMessage: function (res) {
    let member_id = app.globalData.userInfo.member_id
    return {
      title: '成纪先锋微平台',
      path: '/pages/mine/info?inviter_id=' + member_id,
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },
  onLoad: function (options) {
    this.setData({ userInfo: app.globalData.userInfo })
    app.ajax("member_info", { rd_session: wx.getStorageSync('rd_session') }, (data, err) => {
      this.setData({
        info:data.data.data
      })
    })
    if(this.data.isyes){
      this.setData({
        identity:true,
        unidentity:false
      })
    }else{
      this.setData({
        identity: false,
        unidentity: true
      })
    }
  },
  editphone(){
    this.setData({
      editdialog:true
    })
  },
  infocanel(){
    this.setData({
      infodialog: false
    })
  },
  //确认绑定
  binding(){
    this.setData({
      infodialog: true
    })
  },
  formSubmit2: function (e) {
    console.log('form发生了submit事件，携带数据为：', e.detail.value)
  },
  formReset2: function () {
    this.setData({
      editdialog: false
    })
  }
});